package cn.edu.sptc.liaoyu.hellospring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/data")

public class DataController {

    @RequestMapping(method = RequestMethod.GET,value = "/hello")
    @ResponseBody
    public String json() {
        return "返回数据是json字符串";
    }

    @RequestMapping(method = RequestMethod.GET,value ="/html")
    public String getHTML(){
        return "home";
    }

}